
#include "AbstractManager.hpp"

namespace NSCore {

	AbstractManager::AbstractManager() :
		QObject(),
		AbstractObject()
	{


	}

	AbstractManager::~AbstractManager() {

	}


	void AbstractManager::registerObject(AbstractObject* ins) {
		if (!ins) return;
		QString name = ins->className();
		if (!m_objects.contains(name)) {
			m_objects.insert(name, ins);
		}
	}

	AbstractObject* AbstractManager::getObject(QString name) {
		if (m_objects.contains(name)) {
			AbstractObject* ins = m_objects.value(name);
			return ins;
		}
		return nullptr;
	}

}